package com.dayaokeji.rhythmschoolstudent.databases.dao;

import com.dayaokeji.rhythmschoolstudent.client.common.base.App;
import com.dayaokeji.rhythmschoolstudent.databases.model.Answer;
import com.litesuits.orm.db.assit.QueryBuilder;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Gorden on 2017/10/28.
 */

public class AnswerDao {

    /**
     * 获取答案列表
     * @return
     */
    public static List<Answer> getAnswerAll() {
        try {
            return App.getInstance().getLiteOrm().query(Answer.class);
        }catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }

    public static void add(Answer answer) {
        try {
            App.getInstance().getLiteOrm().insert(answer);
        }catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static void delAll() {
        try{
            App.getInstance().getLiteOrm().delete(Answer.class);
        }catch (Exception e) {
            e.printStackTrace();
        }
    }
}
